package vista.ventanas;

import vista.paneles.PanelParLabelText;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Window;

@SuppressWarnings("serial")
public class VentanaDiagramaHijo extends SubVentana {

	private final static int ALTO_VENTANA = 200;
	
	private PanelParLabelText nombreDiagrama;

	public VentanaDiagramaHijo(Window frame) 
	{
		super(frame, "Diagrama Hijo", ALTO_VENTANA);
	}
	
	public String getNombreDiagrama(){
		return this.nombreDiagrama.getInformacion();
	}
	
	@Override
	protected void agregarComponentesPanelInformacion()
	{
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[]{0, 0};
		gridBagLayout.rowHeights = new int[]{0, 0};
		gridBagLayout.columnWeights = new double[]{1.0, Double.MIN_VALUE};
		gridBagLayout.rowWeights = new double[]{1.0, Double.MIN_VALUE};
		
		getPanelDeInformacion().setLayout(gridBagLayout);
		
		agregarPanelNombre();
	}

	private void agregarPanelNombre() 
	{
		this.nombreDiagrama = new PanelParLabelText("Nombre:");
		
		GridBagConstraints gbc = new GridBagConstraints();
		gbc.gridx = 0;
		gbc.gridy = 0;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		
		getPanelDeInformacion().add(nombreDiagrama, gbc);
	}
}
